#ifndef MANAGEMENTDBOPERATIONS_H
#define MANAGEMENTDBOPERATIONS_H

#include <QMessageBox>
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlQuery>
    
extern bool connectManagementDB(QString dbName);

extern void closeManagementDB();

extern void removeManagementDB();
    
extern bool initManagementDB();
    
extern int getNextProjectID();

extern int getNextDeviceID();
    
extern bool addProject(int projectID, QString projectName, 
                    QString projectCreateDateTime, QString projectLastChangeDateTime);

extern bool addDevice(int deviceID, QString name, QString manufacturers, QString orderNum,
                      QString mediumType, QString appProgram, QString version);
    
extern bool deleteProject(int projectID);

extern bool deleteDevice(int deviceID);

extern bool updateProjectName(int projectID, QString projectName);
    
extern bool updateProjectLastChangeDateTime(int projectID, QString lastChangeDateTime);
    
extern bool updateProjectFlagByID(int projectID, int flagValue);
    
extern bool getOneProjectInfo(int projectID);
    
extern int getProjectIDByFlag(int falgValue);

#endif // MANAGEMENTDBOPERATIONS_H
